package demo02ClassObj;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:咭咭熊
 * Date:2021 - 09 - 13
 * Time:15:31
 */
public class HasStatic {
    private static int x = 100;

    public static void main(String[] args) {
        HasStatic hasStatic1 = new HasStatic();
        hasStatic1.x++;//101

        HasStatic hasStatic2 = new HasStatic();
        hasStatic2.x++;//102

        hasStatic1 = new HasStatic();
        hasStatic1.x++;//103
        HasStatic.x--;//102
        System.out.println("x = " + x);//x = 102
    }

}
